<!--#
 @version 0.2 (auto-set)
#-->

<!-- Table 'layouts' edit -->

<form action="?" method="post" enctype="multipart/form-data" name="frmEdit" class="form-horizontal">
[#if OK#]

<div class="alert alert-success">
<#LANG_DATA_SAVED#>
</div>

[#endif OK#]
[#if ERR#]

<div class="alert alert-error">
<#LANG_FILLOUT_REQURED#>
</div>

[#endif ERR#]
[#if ID=""#]

<#LANG_NEW_RECORD#>

[#endif ID#]
<!-- TITLE (varchar) -->

<div class="control-group">
        <label class="control-label"><#LANG_TITLE#>(*)</label>
        <div class="controls">
                <input type="text" name="title" value="[#TITLE#]" required>
        </div>
</div>

<!-- PRIORITY (int) -->

<div class="control-group">
        <label class="control-label"><#LANG_PRIORITY#></label>
        <div class="controls">
                <input type="text" name="priority" value="[#PRIORITY#]">
        </div>
</div>

<!-- TYPE (select) -->

<div class="control-group">
        <label class="control-label"><#LANG_AUTO_UPDATE_PERIOD#></label>
        <div class="controls">
                <input type="text" name="refresh" value="[#REFRESH#]">
        </div>
</div>


<div class="control-group">
        <label class="control-label"><#LANG_TYPE#></label>
        <div class="controls">
                <select name="type">
                <option value="">select
                [#begin TYPE_OPTIONS#]<option value="[#VALUE#]"[#if SELECTED#] selected[#endif#]>[#TITLE#]
                [#end TYPE_OPTIONS#]
                </select>
        </div>
</div>

<!-- CODE (text) -->
[#if TYPE="html"#]

<div class="control-group">
        <label class="control-label"><#LANG_CODE#></label>
        <div class="controls">
                <textarea name="code" rows=12 cols=100>[#CODE#]</textarea>
        </div>
</div>

[#endif TYPE#]
[#if TYPE="app"#]
<!-- APP (varchar) -->


<div class="control-group">
        <label class="control-label"><#LANG_APP#></label>
        <div class="controls">
                <input type="text" name="appname" value="[#APP#]">
        </div>
</div>

[#endif TYPE#]
[#if TYPE="url"#]

<div class="control-group">
        <label class="control-label"><#LANG_URL#></label>
        <div class="controls">
                <input type="text" name="url" value="[#URL#][#if URL=""#]http://[#endif#]">
        </div>
</div>

[#endif TYPE#]

[#if ID!=""#]
<div class="control-group">
        <label class="control-label"><#LANG_URL#> (preview):</label>
        <div class="controls">

[#if TYPE="html"#]
<a href="/page/[#ID#].html" target=_blank>/page/[#ID#].html</a>
[#endif TYPE#]

[#if TYPE="url"#]
<a href="[#URL#]" target=_blank>[#URL#]</a>
[#endif TYPE#]

[#if TYPE="app"#]
<a href="/popup/[#APP#].html" target=_blank>/popup/[#APP#].html</a>
[#endif TYPE#]
        
        </div>
</div>

<div class="form-actions">
<button class="btn" type="submit" name="subm"><i class="icon-ok"></i> <#LANG_SUBMIT#></button>
[#else ID#]
<div class="form-actions">
<button class="btn" type="submit" name="subm"><i class="icon-plus-sign"></i> <#LANG_ADD#></button>
[#endif ID#]

<a class="btn" href="?"><#LANG_CANCEL#></a>
</div>
<input type="hidden" name="id" value="<#ID#>">
<input type="hidden" name="view_mode" value="<#VIEW_MODE#>">
<input type="hidden" name="edit_mode" value="<#EDIT_MODE#>">
<input type="hidden" name="mode" value="update">
</form>